/*
* Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved.
*/

#include "vpc_pipe_resize.h"

static resize_method_cfg_t g_resize_method_cfg[10] = {
    // BILINEAR
    {
        .func_type = 0,
        .align_mode = 0,
        .rnd_ctrl = 2,
    },
    // NEAREST
    {
        .func_type = 1,
        .align_mode = 1,
        .rnd_ctrl = 2,
    },
    // BICUBIC
    {
        .func_type = 2,
        .align_mode = 0,
        .rnd_ctrl = 2,
    },
    // AREA
    {
        .func_type = 3,
        .align_mode = 1,
        .rnd_ctrl = 2,
    },
    // YUV_SCALE
    {
        .func_type = 0,
        .align_mode = 0,
        .rnd_ctrl = 0,
    },
    // BILINEAR_ABANDONED
    {
        .func_type = 0,
        .align_mode = 0,
        .rnd_ctrl = 1,
    },
    // NEAREST_ABANDONED
    {
        .func_type = 1,
        .align_mode = 0,
        .rnd_ctrl = 1,
    },
};

uint32_t get_func_type(vpc_pipe_resize_mode_e mode)
{
    return g_resize_method_cfg[mode].func_type;
}

uint32_t get_align_mode(vpc_pipe_resize_mode_e mode)
{
    return g_resize_method_cfg[mode].align_mode;
}

uint32_t get_rnd_ctrl(vpc_pipe_resize_mode_e mode)
{
    return g_resize_method_cfg[mode].rnd_ctrl;
}